package com.Jin.controller;

import com.Jin.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class ForwardControl {

    //主页
    @GetMapping("/")
    public String index1(){
        return "index";
    }

    //进入主页
    @GetMapping("/index")
    public String index2(){
        return "index";
    }

    //进入用户页面
    @GetMapping("/usermain")
    public String login(Model model, HttpServletRequest req){
//        User user = (User) req.getSession().getAttribute("user");
//        model.addAttribute("userNames",user.getName());
//        model.addAttribute("userAccounts",user.getAccount());
        return "usermain";
    }

    //进入管理员页面
    @GetMapping("/rootmain")
    public String logins(){
        return "rootmain";
    }


    //进入注册页面
    @GetMapping("/register")
    public String register(){
        return "register";
    }
}
